﻿<%@ Page Title="Edit Redirect Type" Language="C#" MasterPageFile="~/Administration/MasterPage.master" AutoEventWireup="true" CodeFile="Detail.aspx.cs" Inherits="Administration_RedirectTypes_Detail" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" runat="Server">
    <altairis:AutoModeFormView ID="AutoModeFormView1" runat="server" DefaultRedirectUrl="Default.aspx" DataKeyNames="RedirectTypeId" DataSourceID="LinqDataSource1" DefaultMode="Edit" InsertPageTitle="New Redirect Type" EditPageTitle="Edit Redirect Type">
        <InsertItemTemplate>
            <table class="form">
                <tbody>
                    <tr>
                        <th>
                            <asp:Label ID="Label1" runat="server" Text="Title:" AssociatedControlID="TitleTextBox" ToolTip="Friendly title used across the administration interface." />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Title is missing" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" />
                        </th>
                        <td>
                            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' Width="500px" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label2" runat="server" Text="Status code:" AssociatedControlID="StatusCodeTextBox" ToolTip="Numeric HTTP status code, such as 404" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Status code is missing" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" />
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="Status code out of range" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" MaximumValue="505" MinimumValue="100" Type="Integer" />
                        </th>
                        <td>
                            <asp:TextBox ID="StatusCodeTextBox" runat="server" Text='<%# Bind("StatusCode") %>' MaxLength="3" Width="50" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label3" runat="server" Text="Status description:" AssociatedControlID="StatusDescriptionTextBox" ToolTip="Text of HTTP status, such as 'Object Not Found'" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Status description is missing" ControlToValidate="StatusDescriptionTextBox" Text="*" Display="dynamic" />
                        </th>
                        <td>
                            <asp:TextBox ID="StatusDescriptionTextBox" runat="server" Text='<%# Bind("StatusDescription") %>' Width="500px" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label4" runat="server" Text="Location header:" ToolTip="If checked, use 'Location' header to perform redirect" />
                        </th>
                        <td>
                            <asp:CheckBox ID="UseLocationHeaderCheckBox" runat="server" Checked='<%# Bind("UseLocationHeader") %>' Text="append 'Location' header" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label5" runat="server" Text="Response body:" ToolTip="Text of response sent to client" />
                            <dl style="font-weight: normal">
                                <dt>Placeholders available:</dt>
                                <dd><code>{0}</code> = redirect location</dd>
                                <dd><code>{1}</code> = original location</dd>
                                <dd><code>{2}</code> = status code</dd>
                                <dd><code>{3}</code> = status description</dd>
                            </dl>
                        </th>
                        <td>
                            <asp:TextBox ID="ResponseBodyTextBox" runat="server" Text='<%# Bind("ResponseBody") %>' Width="500px" Height="300px" TextMode="MultiLine" />
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <td colspan="2">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                        <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Submit" />
                        <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </td>
                </tfoot>
            </table>
        </InsertItemTemplate>
        <EditItemTemplate>
            <table class="form">
                <tbody>
                    <tr>
                        <th>Date created:</th>
                        <td>
                            <span class="strong" style="float: right">
                                <altairis:IconLinkButton runat="server" Icon="LinkDelete" CommandName="Delete" CausesValidation="false" AlternateText="Delete this redirect type" ID="IconLinkButton1" />
                                <ajax:ConfirmButtonExtender ID="IconLinkButton1_ConfirmButtonExtender" runat="server" ConfirmText="Are you sure you want to delete this redirect type and all related data?" Enabled="True" TargetControlID="IconLinkButton1"></ajax:ConfirmButtonExtender>
                                <asp:LinkButton runat="server" CommandName="Delete" CausesValidation="false" Text="Delete this redirect type" ID="LinkButton1" />
                                <ajax:ConfirmButtonExtender ID="LinkButton1_ConfirmButtonExtender" runat="server" ConfirmText="Are you sure you want to delete this redirect type and all related data?" Enabled="True" TargetControlID="LinkButton1"></ajax:ConfirmButtonExtender>
                            </span>
                            <altairis:DateLabel ID="DateLabel1" runat="server" DateValue='<%# Eval("DateCreated") %>' />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label1" runat="server" Text="Title:" AssociatedControlID="TitleTextBox" ToolTip="Friendly title used across the administration interface." />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Title is missing" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" />
                        </th>
                        <td>
                            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' Width="500px" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label2" runat="server" Text="Status code:" AssociatedControlID="StatusCodeTextBox" ToolTip="Numeric HTTP status code, such as 404" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Status code is missing" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" />
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="Status code out of range" ControlToValidate="StatusCodeTextBox" Text="*" Display="dynamic" MaximumValue="505" MinimumValue="100" Type="Integer" />
                        </th>
                        <td>
                            <asp:TextBox ID="StatusCodeTextBox" runat="server" Text='<%# Bind("StatusCode") %>' MaxLength="3" Width="50" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label3" runat="server" Text="Status description:" AssociatedControlID="StatusDescriptionTextBox" ToolTip="Text of HTTP status, such as 'Object Not Found'" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Status description is missing" ControlToValidate="StatusDescriptionTextBox" Text="*" Display="dynamic" />
                        </th>
                        <td>
                            <asp:TextBox ID="StatusDescriptionTextBox" runat="server" Text='<%# Bind("StatusDescription") %>' Width="500px" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label4" runat="server" Text="Location header:" ToolTip="If checked, use 'Location' header to perform redirect" />
                        </th>
                        <td>
                            <asp:CheckBox ID="UseLocationHeaderCheckBox" runat="server" Checked='<%# Bind("UseLocationHeader") %>' Text="append 'Location' header" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="Label5" runat="server" Text="Response body:" ToolTip="Text of response sent to client" />
                            <dl style="font-weight: normal">
                                <dt>Placeholders available:</dt>
                                <dd><code>{0}</code> = redirect location</dd>
                                <dd><code>{1}</code> = original location</dd>
                                <dd><code>{2}</code> = status code</dd>
                                <dd><code>{3}</code> = status description</dd>
                            </dl>
                        </th>
                        <td>
                            <asp:TextBox ID="ResponseBodyTextBox" runat="server" Text='<%# Bind("ResponseBody") %>' Width="500px" Height="300px" TextMode="MultiLine" />
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="2">
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                            <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Update" Text="Submit" />
                            <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                        </td>
                    </tr>
                </tfoot>
            </table>
        </EditItemTemplate>
    </altairis:AutoModeFormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SwitchboardDataContext" EnableInsert="True" EnableUpdate="True" EnableDelete="true" TableName="RedirectTypes" Where="RedirectTypeId == @RedirectTypeId">
        <WhereParameters>
            <asp:QueryStringParameter Name="RedirectTypeId" QueryStringField="RedirectTypeId" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
